<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" src="https://imgs.qunarzz.com/vc/21/b8/5f/10f6d6b052d08a70001740d880.jpg_92.jpg">
      <div class="banner-info">
        <div class="banner-title">
          罗茶海(AAAAA级景区)
        </div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe647;</span>39
        </div>
      </div>
    </div>
    <common-gallary
      :imgs="imgs"
      v-show="showGallary"
      @close="handleGallaryClose"
    />
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
export default {
  name: 'DetailBanner',
  data () {
    return {
      showGallary: false,
      imgs: ['https://imgs.qunarzz.com/p/p66/201304/17/384810d022dd28f793835fbb.jpg_216x190_9cdf9f18.jpg',
        'https://imgs.qunarzz.com/p/p5/1411/67/677f3ca100291a23213a9cdb.jpg_216x190_037c7ea8.jpg',
        'https://imgs.qunarzz.com/p/p29/201302/28/3d20251a1b60350a93835fbb.jpg_216x190_f6cbf916.jpg']
    }
  },
  components: {
    CommonGallary
  },
  methods: {
    handleBannerClick: function () {
      this.showGallary = true
    },
    handleGallaryClose: function () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position: relative
    overflow: hidden
    height: 0
    padding-bottom: 55%
    .banner-img
      width: 100%
    .banner-info
      color: #ffffff
      display: flex
      position: absolute
      left: 0
      right: 0
      bottom: 0
      line-height: .6rem
      background-image: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,.8))
      .banner-title
        flex: 1
        font-size: .32rem
        padding: 0 .2rem
      .banner-number
        padding: 0 .4rem
        line-height: .32rem
        height: .32rem
        margin-top: .14rem
        font-size: .24rem
        border-radius: .2rem
        background: rgba(0,0,0,.8)
        .banner-icon
          font-size: .24rem
</style>
